<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GrPPI: grppi::reduce_t&lt; Combiner, Identity &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.svg"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">GrPPI
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">Generic and Reusable Parallel Pattern Interface</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacegrppi.html">grppi</a></li><li class="navelem"><a class="el" href="classgrppi_1_1reduce__t.html">reduce_t</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classgrppi_1_1reduce__t-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">grppi::reduce_t&lt; Combiner, Identity &gt; Class Template Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Representation of reduce pattern. Represents a reduction that can be used as a stage on a pipeline.  
 <a href="classgrppi_1_1reduce__t.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="reduce__pattern_8h_source.html">reduce_pattern.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ab2eaf12acd4842c4b4399fd759b462ed"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrppi_1_1reduce__t.html#ab2eaf12acd4842c4b4399fd759b462ed">reduce_t</a> (int wsize, int <a class="el" href="classgrppi_1_1reduce__t.html#a6f82cf1a5545bb96bda3fc8cd079279d">offset</a>, Identity id, Combiner &amp;&amp;combine_op)</td></tr>
<tr class="memdesc:ab2eaf12acd4842c4b4399fd759b462ed"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct a reduction pattern object.  <a href="classgrppi_1_1reduce__t.html#ab2eaf12acd4842c4b4399fd759b462ed">More...</a><br /></td></tr>
<tr class="separator:ab2eaf12acd4842c4b4399fd759b462ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7319e39544c636e08643bc7f572def58"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrppi_1_1reduce__t.html#a7319e39544c636e08643bc7f572def58">add_item</a> (Identity &amp;&amp;item)</td></tr>
<tr class="memdesc:a7319e39544c636e08643bc7f572def58"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add an item to the reduction buffer. If there are remaining items before reaching the next window start the item is discarded.  <a href="classgrppi_1_1reduce__t.html#a7319e39544c636e08643bc7f572def58">More...</a><br /></td></tr>
<tr class="separator:a7319e39544c636e08643bc7f572def58"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a890baaf65c8b1d05bcbfb02d54bfd74c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrppi_1_1reduce__t.html#a890baaf65c8b1d05bcbfb02d54bfd74c">reduction_needed</a> () const</td></tr>
<tr class="memdesc:a890baaf65c8b1d05bcbfb02d54bfd74c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if a reduction can be performed.  <a href="classgrppi_1_1reduce__t.html#a890baaf65c8b1d05bcbfb02d54bfd74c">More...</a><br /></td></tr>
<tr class="separator:a890baaf65c8b1d05bcbfb02d54bfd74c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a55cbf4126c334c7e8c431be1026c4dab"><td class="memItemLeft" align="right" valign="top">Combiner&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrppi_1_1reduce__t.html#a55cbf4126c334c7e8c431be1026c4dab">combiner</a> () const</td></tr>
<tr class="memdesc:a55cbf4126c334c7e8c431be1026c4dab"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the combiner.  <a href="classgrppi_1_1reduce__t.html#a55cbf4126c334c7e8c431be1026c4dab">More...</a><br /></td></tr>
<tr class="separator:a55cbf4126c334c7e8c431be1026c4dab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a66f3a25a94d263817120fabb310cec9f"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrppi_1_1reduce__t.html#a66f3a25a94d263817120fabb310cec9f">window_size</a> () const</td></tr>
<tr class="memdesc:a66f3a25a94d263817120fabb310cec9f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the window size.  <a href="classgrppi_1_1reduce__t.html#a66f3a25a94d263817120fabb310cec9f">More...</a><br /></td></tr>
<tr class="separator:a66f3a25a94d263817120fabb310cec9f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6f82cf1a5545bb96bda3fc8cd079279d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrppi_1_1reduce__t.html#a6f82cf1a5545bb96bda3fc8cd079279d">offset</a> () const</td></tr>
<tr class="memdesc:a6f82cf1a5545bb96bda3fc8cd079279d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the offset.  <a href="classgrppi_1_1reduce__t.html#a6f82cf1a5545bb96bda3fc8cd079279d">More...</a><br /></td></tr>
<tr class="separator:a6f82cf1a5545bb96bda3fc8cd079279d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a14fd59017bf9aae3e37eabd38c75f849"><td class="memTemplParams" colspan="2">template&lt;typename E &gt; </td></tr>
<tr class="memitem:a14fd59017bf9aae3e37eabd38c75f849"><td class="memTemplItemLeft" align="right" valign="top">auto&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classgrppi_1_1reduce__t.html#a14fd59017bf9aae3e37eabd38c75f849">reduce_window</a> (const E &amp;e)</td></tr>
<tr class="memdesc:a14fd59017bf9aae3e37eabd38c75f849"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reduce values from a window.  <a href="classgrppi_1_1reduce__t.html#a14fd59017bf9aae3e37eabd38c75f849">More...</a><br /></td></tr>
<tr class="separator:a14fd59017bf9aae3e37eabd38c75f849"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae9d3ca10ac55a5ae2a557610cb5f2233"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:ae9d3ca10ac55a5ae2a557610cb5f2233"><td class="memTemplItemLeft" align="right" valign="top">auto&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classgrppi_1_1reduce__t.html#ae9d3ca10ac55a5ae2a557610cb5f2233">operator()</a> (T &amp;&amp;)</td></tr>
<tr class="separator:ae9d3ca10ac55a5ae2a557610cb5f2233"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename Combiner, typename Identity&gt;<br />
class grppi::reduce_t&lt; Combiner, Identity &gt;</h3>

<p>Representation of reduce pattern. Represents a reduction that can be used as a stage on a pipeline. </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">Combiner</td><td>Callable type for the combine operation used in the reduction. </td></tr>
    <tr><td class="paramname">Identity</td><td>Identity value for the combiner. </td></tr>
  </table>
  </dd>
</dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ab2eaf12acd4842c4b4399fd759b462ed"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab2eaf12acd4842c4b4399fd759b462ed">&#9670;&nbsp;</a></span>reduce_t()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Combiner , typename Identity &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classgrppi_1_1reduce__t.html">grppi::reduce_t</a>&lt; Combiner, Identity &gt;::<a class="el" href="classgrppi_1_1reduce__t.html">reduce_t</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>wsize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Identity&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Combiner &amp;&amp;&#160;</td>
          <td class="paramname"><em>combine_op</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Construct a reduction pattern object. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">wsize</td><td>Window size. </td></tr>
    <tr><td class="paramname">offset</td><td>Offset between window starts. </td></tr>
    <tr><td class="paramname">Id</td><td>Identity value. </td></tr>
    <tr><td class="paramname">combine_op</td><td>Combiner used for the reduction. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a7319e39544c636e08643bc7f572def58"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7319e39544c636e08643bc7f572def58">&#9670;&nbsp;</a></span>add_item()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Combiner , typename Identity &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classgrppi_1_1reduce__t.html">grppi::reduce_t</a>&lt; Combiner, Identity &gt;::add_item </td>
          <td>(</td>
          <td class="paramtype">Identity &amp;&amp;&#160;</td>
          <td class="paramname"><em>item</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Add an item to the reduction buffer. If there are remaining items before reaching the next window start the item is discarded. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">item</td><td>to be added. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a55cbf4126c334c7e8c431be1026c4dab"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a55cbf4126c334c7e8c431be1026c4dab">&#9670;&nbsp;</a></span>combiner()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Combiner , typename Identity &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">Combiner <a class="el" href="classgrppi_1_1reduce__t.html">grppi::reduce_t</a>&lt; Combiner, Identity &gt;::combiner </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get the combiner. </p>
<dl class="section return"><dt>Returns</dt><dd>The combiner held by the reduction object. </dd></dl>

</div>
</div>
<a id="a6f82cf1a5545bb96bda3fc8cd079279d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6f82cf1a5545bb96bda3fc8cd079279d">&#9670;&nbsp;</a></span>offset()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Combiner , typename Identity &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classgrppi_1_1reduce__t.html">grppi::reduce_t</a>&lt; Combiner, Identity &gt;::offset </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get the offset. </p>
<dl class="section return"><dt>Returns</dt><dd>The offset the reduction object. </dd></dl>

</div>
</div>
<a id="ae9d3ca10ac55a5ae2a557610cb5f2233"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae9d3ca10ac55a5ae2a557610cb5f2233">&#9670;&nbsp;</a></span>operator()()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Combiner , typename Identity &gt; </div>
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">auto <a class="el" href="classgrppi_1_1reduce__t.html">grppi::reduce_t</a>&lt; Combiner, Identity &gt;::operator() </td>
          <td>(</td>
          <td class="paramtype">T &amp;&amp;&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="a14fd59017bf9aae3e37eabd38c75f849"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a14fd59017bf9aae3e37eabd38c75f849">&#9670;&nbsp;</a></span>reduce_window()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Combiner , typename Identity &gt; </div>
<div class="memtemplate">
template&lt;typename E &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">auto <a class="el" href="classgrppi_1_1reduce__t.html">grppi::reduce_t</a>&lt; Combiner, Identity &gt;::reduce_window </td>
          <td>(</td>
          <td class="paramtype">const E &amp;&#160;</td>
          <td class="paramname"><em>e</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Reduce values from a window. </p>
<dl class="section return"><dt>Returns</dt><dd>The result of the reduction. </dd></dl>

</div>
</div>
<a id="a890baaf65c8b1d05bcbfb02d54bfd74c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a890baaf65c8b1d05bcbfb02d54bfd74c">&#9670;&nbsp;</a></span>reduction_needed()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Combiner , typename Identity &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classgrppi_1_1reduce__t.html">grppi::reduce_t</a>&lt; Combiner, Identity &gt;::reduction_needed </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Check if a reduction can be performed. </p>
<dl class="section pre"><dt>Precondition</dt><dd>items.size() &lt; static_cast&lt;int&gt;(std::numeric_limits&lt;int&gt;::max()) </dd></dl>

</div>
</div>
<a id="a66f3a25a94d263817120fabb310cec9f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a66f3a25a94d263817120fabb310cec9f">&#9670;&nbsp;</a></span>window_size()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Combiner , typename Identity &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classgrppi_1_1reduce__t.html">grppi::reduce_t</a>&lt; Combiner, Identity &gt;::window_size </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get the window size. </p>
<dl class="section return"><dt>Returns</dt><dd>The window size of the reduction object. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="reduce__pattern_8h_source.html">reduce_pattern.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2
</small></address>
</body>
</html>
